import request from '@/utils/request'
import {
  renderUrl
} from '../utils'

const headers = {
  'Content-Type': 'application/json'
}

// 商品审核
export function productupdataverifyStatus(data) {
  return request({
    url: '/admin/product/updata/verifyStatus',
    method: 'POST',
    data: JSON.stringify(data),
    headers,
    extraConfig: {
      loading: false
    }
  })
}

// 删除还原商品
export function productdelete(data) {
  return request({
    url: '/admin/product/delete',
    method: 'POST',
    data: JSON.stringify(data),
    headers,
    extraConfig: {
      loading: false
    }
  })
}

export function add(data) {
  return request({
    url: '/admin/product/add',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function edit(data) {
  return request({
    url: '/admin/product/update',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export function del(data) {

  return request({
    url: renderUrl('/admin/product/delete/{id}', data),
    method: 'GET'
  })
}
export function publishStatus(data) {
  return request({
    url: '/admin/product/update/publishStatus',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}
export function operationupdate(data) {
  return request({
    url: '/admin/operation/feedback/update',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}
export function feedbackdel(data) {
  return request({
    url: '/admin/operation/feedback/del',
    method: 'POST',
    data: JSON.stringify(data),
    headers
  })
}

export default {
  add,
  edit,
  del
}
